<template>
  <div>
    <div class="list_model">
      <!-- 标题 -->
      <div class="list_title">
        <h3 class="fl" id="model01">新鲜水果</h3>
        <div class="subtitle fl">
          <span>|</span>
          <a href="#" v-for="item in titles_list" :key="item.id">{{
            item.name
          }}</a>
        </div>

        <a href="#" class="goods_more fr" id="fruit_more">查看更多 ></a>
      </div>

      <!-- 商品模块-->
      <div class="goods_con">
        <!-- 左侧大图 -->
        <div class="goods_banner fl">
          <img src="../assets/banner01.jpg" />
        </div>

        <!-- 每一个列表项 -->
        <ul class="goods_list fl">
          <li v-for="item in goods_list" :key="item.id">
            <h4>
              <a href="#">{{ item.name }}</a>
            </h4>
            <a href="#">
              <img :src="host + item.image" />
            </a>
            <div class="prize">¥ {{ item.price }}</div>
          </li>
        </ul>

      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "GoodList",
  data() {
    return {
      host: "http://localhost:8000",
      // titles_list: [
      //   {
      //     id: 1,
      //     name: "鲜芒",
      //   },
      //   {
      //     id: 2,
      //     name: "加州提子",
      //   },
      //   {
      //     id: 3,
      //     name: "亚马逊牛油果",
      //   },
      // ],

      // goods_list: [
      //   {
      //     id: 1,
      //     name: "草莓",
      //     image: "/static/images/goods/goods003.jpg",
      //     price: 30.0,
      //   },
      //   {
      //     id: 2,
      //     name: "葡萄",
      //     image: "/static/images/goods/goods002.jpg",
      //     price: 5.5,
      //   },
      //   {
      //     id: 3,
      //     name: "柠檬",
      //     image: "/static/images/goods/goods001.jpg",
      //     price: 3.9,
      //   },
      //   {
      //     id: 4,
      //     name: "奇异果",
      //     image: "/static/images/goods/goods012.jpg",
      //     price: 25.8,
      //   },
      // ],
    };
  },
  props: ["titles_list", "goods_list"],

  components: {},

  mounted() {},

  methods: {},
};
</script>

<style scoped>
* {
  margin: 0;
}

.fl {
  float: left;
}

.list_model {
  width: 1200px;
  height: 340px;
  margin: 15px auto 0;
  /* background-color: lightblue; */
}

.list_title {
  /* background-color: pink; */
  height: 40px;
  line-height: 40px; /*垂直居中*/
  border-bottom: 2px solid #42ad46;
}

.list_title h3 {
  height: 40px;
  line-height: 40px;
  font-size: 16px;
  color: #37ab40;
  font-weight: bold;
}

.list_title .subtitle {
  height: 20px;
  line-height: 20px;
  margin-top: 15px;
}

.list_title .subtitle span {
  color: #666;
  margin: -1px 10px 0 20px;
}

.list_title .subtitle a {
  color: #666;
  margin: 0 5px;
  text-decoration-line: none;
}

.list_title .subtitle a:hover,
.goods_more:hover {
  color: #ff8800;
}

/* 更多商品的链接  a行内块元素 */
.goods_more {
  height: 20px;
  margin-top: 5px;
  color: #666;
  text-decoration-line: none;
  /* background-color: pink; */
}
.fr {
  float: right;
}

/* 标题下的商品模块 */
.goods_con {
  height: 300px;
  /* background-color: pink; */
}

/* 左侧商品大图 */
.goods_banner {
  width: 200px;
  height: 300px;
}

.goods_banner img {
  width: 200px;
  height: 300px;
}

/* 商品列表 */
.goods_list {
  margin:0;
  padding:0;
  border-left:0;
  border-right:0;
  width: 1000px;
  height: 299px;
  border-bottom: 1px solid #ededed;
  /* background-color: pink; */
  list-style-type: none;
}

.goods_list li {
  height: 299px;
  width: 249px;
  border-right: 1px solid #ededed;
  float: left;
  
}

.goods_list li:hover {
  width: 248px;
  height: 297px;
  border: 1px solid gold;
}

.goods_list li:hover img {
  opacity: 0.8;
}

.goods_list li h4 {
  width: 200px;
  height: 50px;
  margin: 20px auto 0;
  text-align: center;
  /* background-color: pink; */
}

.goods_list li h4 a {
  font-size: 14px;
  color: #666;
  font-weight: normal;
  line-height: 24px;
  text-decoration-line: none
}

.goods_list li h4 a:hover {
  color: #ff8800;
}

.goods_list li img {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.goods_list li .prize {
  text-align: center;
  font-size: 20px;
  color: #c40000;
  margin-top: 5px;
}
</style>
